package Boundary;

import Auxiliary.Sequence_Type;
import DataView.EventInfo;
import DataView.Sequence_Error;
import Executor.Main;
import Interfaces.ShowEventsAndCondReacts;
import Store.Element;
import Store.Event;
import Visualization.EventCondReactVis;

public class UpdateEventCondReact extends BaseBoundary {
	public EventCondReactVis currentEVCR;
	public Sequence_Type availableTypes;
	ShowEventsAndCondReacts interfaccia = new ShowEventsAndCondReacts(this);
	public Main main;

	public UpdateEventCondReact(Main main){
		this.main=main;
	}
	public void mkUpdateEventCondReact(EventCondReactVis aCdDVis, Sequence_Type aTypes) {
		currentEVCR=aCdDVis;
		availableTypes=aTypes;
		main.updateProject.home.display(interfaccia.init(), false);
	}

	public void setEVCR(EventCondReactVis aCdDVis, Sequence_Type aTypes) 
	{
		currentEVCR=aCdDVis;
		availableTypes=aTypes;
		interfaccia.showECR();
	}

	public void correct(Sequence_Error aErrs) 
	{
		interfaccia.showMessage(aErrs.getDescription());
	}

	public void addEvent(EventInfo aEl) 
	{
		main.doAddEvent(aEl);
	}

	public void deleteEvent(Event aEl) 
	{
		main.doDeleteEvent(aEl);
	}

	public void updEvent(Event aEl, EventInfo aNewElIN) 
	{
		main.doUpdEvent(aEl, aNewElIN);
	}
	
	public void validate(Element aEl) 
	{
		main.doValidate(aEl);
	}

	public void generateBasicEV() 
	{
		main.doGenerateBasicEV();
	}
	
	public void ko() 
	{
		interfaccia.showMessage("Error :  No Context Class Selected");
	}
	
	public void close() 
	{
		main.doClose();
	}
}